define([ "ng", "/common/js/query-tester-module.js",
		"/common/js/util-module.js" ], function(angular) {
	var app = angular.module("QueryTesterApp", [ "QueryTesterModule" ]);
	app.value("localStorage", window.localStorage);

	app.controller("QueryTesterCtrl", function($scope, $window, QueryTester) {
		$window.$scope = $scope;
		$scope.send = function() {
			console.log("querying");
			var p = $scope.params;
			if (!p)
				p = "";
			$scope.res = QueryTester.query({
				query : $scope.query,
				params : p
			}, function(o) {
				console.log("Resultados:");
				console.log(o);
			});
		};
		$scope.query = "SELECT a FROM Colegio a";
	});

	return app;
});